package com.xc;

import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class HelloController {

    @PreAuthorize("hasAuthority('test')")
    @GetMapping("/hello")
    public String hello(){
        return "hello";
    }

    @PreAuthorize("hasAuthority('sys:book:list')")
    @GetMapping("/booklist")
    public String booklist(){
        return "booklist";
    }

    @PreAuthorize("hasAuthority('sys:book:delete')")
    @GetMapping("/bookdelete")
    public String bookdelete(){
        return "bookdelete";
    }
}
